package Hilfsklassen;

import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.*;
import javax.swing.border.BevelBorder;
import javax.swing.border.LineBorder;
import javax.swing.plaf.basic.BasicSliderUI.ActionScroller;


public class LoginView extends HintergrundPanel {
		
	public LoginView()
	{
		this.setHintergrundBild("kachelo.png");
		Font componentFont = new Font("Arial", Font.PLAIN, 26);
		this.setSize(600, 400);
		this.setLayout(null);
		this.setBorder(new LineBorder(Color.BLACK, 4));
		
//		JPanel centerPanel = new JPanel(null);
		
		HintergrundPanel titelPanel = new HintergrundPanel("header.jpg");
		titelPanel.setSize(600, 60);
		titelPanel.setBorder(new LineBorder(Color.BLACK, 4));
		
		ColorettoLabel verbindenLabel = new ColorettoLabel("Mit Server verbinden", 20, 10);		
		verbindenLabel.setFett();
		
		ColorettoLabel  portLabel = new ColorettoLabel ("Port", 20, 100);
		ColorettoLabel  ipLabel = new ColorettoLabel ("IP-Adresse des Servers", 20, 200);		
		
		JTextField port = new JTextField();
		port.setLocation(20, 135);
		port.setSize(300, 40);
		port.setFont(componentFont);
		port.setText("8000");
		port.setFont(UIUtils.ladeFont());
		
		JTextField ip = new JTextField();
		ip.setLocation(20, 235);
		ip.setSize(300, 40);
		ip.setFont(componentFont);
		ip.setText("127.0.0.1");
		ip.setFont(UIUtils.ladeFont());
		
		JButton verbindenButton = new JButton("Verbinden");
		verbindenButton.setLocation(20, 300);
		verbindenButton.setSize(240, 40);
		verbindenButton.setFont(UIUtils.ladeFont());
		
		verbindenButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent e){
				HauptFenster.viewAendern("av");
			}
		});
		
		this.setBackground(Color.cyan);
		this.add(verbindenLabel);
		this.add(portLabel);
		this.add(ipLabel);
		this.add(port);
		this.add(ip);
		this.add(titelPanel);
		this.add(verbindenButton);
	}
	
}
